home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / xserver-xorg-input-wacom < prev   
Text File  |  2008-10-21  |  568b  |  33 lines

  1. #!/bin/bash
  2.  
  3. . /lib/lsb/init-functions
  4.  
  5. if [ ! -d /sys/bus/pnp/devices ]; then exit; fi
  6.  
  7. cd /sys/bus/pnp/devices
  8.  
  9. case $1 in
  10.     start|restart|reload|force-reload)
  11.     log_begin_msg "Doing Wacom setup..."
  12.     for x in *; do
  13.     PORT=unknown;
  14.     for y in `cat $x/id`; do
  15.         case "$y" in
  16.         WACf008*|WACf007|WACf006*|WACf005*|WACf004*)
  17.         if [ -d $x/tty ]; then
  18.             PORT=/dev/`ls $x/tty`
  19.         else
  20.             PORT=/dev/`echo $x/tty:* | awk -F: '{print $3}'`
  21.         fi        
  22.         ln -sf $PORT /dev/input/wacom
  23.         ;;
  24.         esac
  25.     done
  26.     done
  27.     log_end_msg 0;
  28.     ;;
  29.     stop)
  30.     exit 0;
  31.     ;;
  32. esac
  33.